

# https://code.qt.io/cgit/qt/qtserialport.git/plain/examples/serialport/terminal/console.cpp?h=5.14

files="
terminal.qrc
console.cpp
console.h
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
settingsdialog.cpp
settingsdialog.h
settingsdialog.ui
terminal.pro
images/application-exit.png
images/clear.png
images/connect.png
images/disconnect.png
images/settings.png
"

base_url="https://code.qt.io/cgit/qt/qtserialport.git/plain/examples/serialport/terminal"
header="?h=5.14"

function download_file()
{
    local url=$1
    local file_name=$2
    # name=`basename $url`
    # name=$url
    mkdir -p `dirname $file_name`
    curl -o $file_name $url
    # mv $name $file_name
}

for f in $files
do
    download_file "$base_url/$f$header" $f
    # download_file "$f$header" $f
done
